package org.csmzxy.class2334;

class Book {
    private String title;
    private String author;
    private int pageCount;

    public Book(String title, String author, int pageCount) {
        if (title != null &&!title.isEmpty() && author != null &&!author.isEmpty() && pageCount > 0) {
            this.title = title;
            this.author = author;
            this.pageCount = pageCount;
        } else {
            System.err.println("书名、作者不能为空，页数必须大于0");
        }
    }

    public void displayBookDetails() {
        System.out.println("书名: " + title);
        System.out.println("作者: " + author);
        this.displayPageCount();
    }

    private void displayPageCount() {
        System.out.println("页数: " + pageCount);
    }

    public void showFullInfo() {
        System.out.println("书籍完整信息 - 书名: " + title + ", 作者: " + author + ", 页数: " + pageCount);
    }
}

public class Example08 {
    public static void main(String[] args) {
        Book book = new Book("Java基础入门", "张三", 400);
        book.displayBookDetails();
        book.showFullInfo();
    }
}